package oracle.apps.financials.collection.po;

import java.util.Date;

import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName = "c_metrics_item")
public class MetricsItem implements Comparable {

	public static final String ITEM_TIME = "itemTime";
	
	public static final String METRICS_ITEM_ID = "metricsItemID";

	@DatabaseField(generatedId = true)

	private Integer metricsItemID;
	
	
	@DatabaseField(dataType=DataType.DATE_STRING, canBeNull = false, index = true,format="yyyy/MM/dd")
	private Date itemTime;
	

	@DatabaseField(canBeNull = false, foreign = true, foreignAutoRefresh = true, columnName = "customerID")
	private Customer customer;
	

	@DatabaseField
	private Date createTime = new Date();

	@DatabaseField
	private double netBalance;
	
	@DatabaseField
	private double accountOverdue;

	@DatabaseField
	private String currency;

	@DatabaseField
	private double daysSalesOutstanding;
	@DatabaseField
	private double bestPossibleDSO;
	@DatabaseField
	private double salesWeightedDSO;
	
	@DatabaseField
	private double salesWeightedDSOAvg;
	
	@DatabaseField
	private double trueDSO;

	@DatabaseField
	private double strategyEffectiveness;

	@DatabaseField
	private double averageDaysLate;

	@DatabaseField
	private double weightedAverageDaysLate;

	@DatabaseField
	private double totalReceipt;

	@DatabaseField
	private double weightedAverageDaysPaid;
	@DatabaseField
	private double percentCurrent;

	@DatabaseField
	private double percent1To30DaysDelinquent;
	@DatabaseField
	private double percent31To60DaysDelinquent;
	@DatabaseField
	private double percent61To90DaysDelinquent;
	@DatabaseField
	private double percent90OverDaysDelinquent;
	
	@DatabaseField
	private double percent90OverDaysDelinquentAvg;

	public double getPercentCurrent() {
		return percentCurrent;
	}

	public void setPercentCurrent(double percentCurrent) {
		this.percentCurrent = percentCurrent;
	}

	public double getPercent1To30DaysDelinquent() {
		return percent1To30DaysDelinquent;
	}

	public void setPercent1To30DaysDelinquent(double percent1To30DaysDelinquent) {
		this.percent1To30DaysDelinquent = percent1To30DaysDelinquent;
	}

	public double getPercent31To60DaysDelinquent() {
		return percent31To60DaysDelinquent;
	}

	public void setPercent31To60DaysDelinquent(double percent31To60DaysDelinquent) {
		this.percent31To60DaysDelinquent = percent31To60DaysDelinquent;
	}

	public double getPercent61To90DaysDelinquent() {
		return percent61To90DaysDelinquent;
	}

	public void setPercent61To90DaysDelinquent(double percent61To90DaysDelinquent) {
		this.percent61To90DaysDelinquent = percent61To90DaysDelinquent;
	}

	public double getPercent90OverDaysDelinquent() {
		return percent90OverDaysDelinquent;
	}

	public void setPercent90OverDaysDelinquent(double percent90OverDaysDelinquent) {
		this.percent90OverDaysDelinquent = percent90OverDaysDelinquent;
	}

	public double getNetBalance() {
		return netBalance;
	}

	public void setNetBalance(double netBalance) {
		this.netBalance = netBalance;
	}

	public double getAccountOverdue() {
		return accountOverdue;
	}

	public void setAccountOverdue(double accountOverdue) {
		this.accountOverdue = accountOverdue;
	}

	public double getDaysSalesOutstanding() {
		return daysSalesOutstanding;
	}

	public void setDaysSalesOutstanding(double daysSalesOutstanding) {
		this.daysSalesOutstanding = daysSalesOutstanding;
	}

	public double getBestPossibleDSO() {
		return bestPossibleDSO;
	}

	public void setBestPossibleDSO(double bestPossibleDSO) {
		this.bestPossibleDSO = bestPossibleDSO;
	}

	public double getSalesWeightedDSO() {
		return salesWeightedDSO;
	}

	public void setSalesWeightedDSO(double salesWeightedDSO) {
		this.salesWeightedDSO = salesWeightedDSO;
	}

	public double getTrueDSO() {
		return trueDSO;
	}

	public void setTrueDSO(double trueDSO) {
		this.trueDSO = trueDSO;
	}

	public double getStrategyEffectiveness() {
		return strategyEffectiveness;
	}

	public void setStrategyEffectiveness(double strategyEffectiveness) {
		this.strategyEffectiveness = strategyEffectiveness;
	}

	public double getAverageDaysLate() {
		return averageDaysLate;
	}

	public void setAverageDaysLate(double averageDaysLate) {
		this.averageDaysLate = averageDaysLate;
	}

	public double getWeightedAverageDaysLate() {
		return weightedAverageDaysLate;
	}

	public void setWeightedAverageDaysLate(double weightedAverageDaysLate) {
		this.weightedAverageDaysLate = weightedAverageDaysLate;
	}

	public double getTotalReceipt() {
		return totalReceipt;
	}

	public void setTotalReceipt(double totalReceipt) {
		this.totalReceipt = totalReceipt;
	}

	public double getWeightedAverageDaysPaid() {
		return weightedAverageDaysPaid;
	}

	public void setWeightedAverageDaysPaid(double weightedAverageDaysPaid) {
		this.weightedAverageDaysPaid = weightedAverageDaysPaid;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Date getItemTime() {
		return itemTime;
	}

	public void setItemTime(Date itemTime) {
		this.itemTime = itemTime;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCurrency() {
		return currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public Integer getMetricsItemID() {
		return metricsItemID;
	}

	public void setMetricsItemID(Integer metricsItemID) {
		this.metricsItemID = metricsItemID;
	}

	@Override
	public int compareTo(Object compareItemTime) {
		return this.itemTime.before(((MetricsItem) compareItemTime).itemTime) ? -1 : 1;
	}

	public double getSalesWeightedDSOAvg() {
		return salesWeightedDSOAvg;
	}

	public void setSalesWeightedDSOAvg(double salesWeightedDSOAvg) {
		this.salesWeightedDSOAvg = salesWeightedDSOAvg;
	}

	public double getPercent90OverDaysDelinquentAvg() {
		return percent90OverDaysDelinquentAvg;
	}

	public void setPercent90OverDaysDelinquentAvg(double percent90OverDaysDelinquentAvg) {
		this.percent90OverDaysDelinquentAvg = percent90OverDaysDelinquentAvg;
	}
}
